_realname=gputils
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.5.2
pkgrel=1
pkgdesc='The GNU PIC Utilities for the Microchip PIC microcontrollers family (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://gputils.sourceforge.net'
license=('spdx:GPL-2.0-or-later')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("https://downloads.sourceforge.net/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('62a215e7d5575cd488a5ada66e5708ff402634abe86a9b39e4dbdb19c986ab7e')

build() {
  cd "${_realname}-${pkgver}"

  ./configure \
    --prefix="${MINGW_PREFIX}" \
    --build="${MINGW_CHOST}" \
    --host="${MINGW_CHOST}" \
    --disable-html-doc

  make
}

package() {
  cd "${_realname}-${pkgver}"

  make install DESTDIR="${pkgdir}"

  install -Dm644 COPYING -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}"
}
